import { Http } from '@/common/api'

// ------------供应商类型管理-------------------

export const supplierTypePageListUrl = '/srm/type/page'
/**
 * 查询供应商类型树
 * @param params
 * @return {*|Promise}
 */
export const apiSupplierTypeTree = async (params) => Http.post('/srm/type/tree', params)

/**
 * 新增供应商类型
 * @param params
 * @return {*|Promise}
 */
export const apiAddSupplierType = async (params) => Http.post('/srm/type/add', params)

/**
 * 编辑供应商类型
 * @param params
 * @return {*|Promise}
 */
export const apiEditSupplierType = async (params) => Http.put('/srm/type/update', params)

/**
 * 删除
 * @param ids
 * @return {*|Promise}
 */
export const apiDeleteSupplierType = async (params) => Http.delete('/srm/type/batch/delete', params)

/**
 * 根据ID查询供应商类型
 * @param id
 * @return {*|Promise}
 */
export const apiGetInfo = async (id) => Http.get(`/srm/type/findById/${id}`)

/**
 * 启用供应商类型
 * @param id
 * @return {*|Promise}
 */
export const apiPutEnable = async (params) => Http.put('/srm/type/batch/enable', params)

/**
 * 禁用供应商类型
 * @param id
 * @return {*|Promise}
 */
export const apiPutDisable = async (params) => Http.put('/srm/type/batch/disable', params)
/**
 * 导出供应商类型数据
 * @param params
 * @return {*|Promise}
 */
export const supplierTypeExportUrl = '/upms/org/exportExcel'
